home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / oath.lha / oath / test / bigcd.cc < prev    next >
C/C++ Source or Header  |  1991-08-29  |  608b  |  24 lines

  1. #include "oath/bigInteger.h"
  2.  
  3. #include <iostream.h>
  4.  
  5. main(int argc, char **argv)
  6.    {if(argc != 3)
  7.        {cout << argv[0] << " reads two bigInteger's and produces sums.\n";
  8.         cout << "Usage: " << argv[0] << " <integer> <integer>\n";
  9.         exit(1);
  10.        }
  11.  
  12.     bigIntegerA X = bigIntegerA::make(argv[1]);
  13.     bigIntegerA Y = bigIntegerA::make(argv[2]);
  14.  
  15.     cout << "   X = " << X << endl;
  16.     cout << "   Y = " << Y << endl;
  17.  
  18.     cout << " gcd = " << (+X).gcd(Y) << endl;
  19.     cout << " lcm = " << (+X).lcm(Y) << endl;
  20.  
  21.     cout << "   X = " << X << endl;
  22.     cout << "   Y = " << Y << endl;
  23.    }
  24.